<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Weex HTML5</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="apple-touch-fullscreen" content="yes" />
  <meta name="format-detection" content="telephone=no, email=no" />
  <style>
    html, body, #weex {
      width: 100%;
      height: 100%;
    }
  </style>
  <link rel="stylesheet" href="http://47.93.112.226/uploader/app/reset.css" type="text/css">
  <script src="./node_modules/weex-html5/dist/weex.js"></script>
</head>
<body>
  <div id="weex"></div>
  <script>
  /**
   * Init weex instance depending on the url params.
   * There are three ways to load weex bundles, depends on the
   * parameter 'loader' in the url:
   *
   *   + xhr: use XMLHttpRequest. Parameter 'page' should be
   *   the bundle's url.
   *   + source: use the transformed code itself. 'page' should
   *   be the transformed weex bundle.
   *
   * @param {String} bundle - It has different meaning depends on
   *   the type of loader.
   */
  (function () {
    function getUrlParam (key) {
      var reg = new RegExp('[?|&]' + key + '=([^&]+)')
      var match = location.search.match(reg)
      return match && match[1]
    }

    var loader = getUrlParam('loader') || 'xhr'
    var page = getUrlParam('page') || './dist/index.js'
    console.log("=========="+getUrlParam('page'));
  window.weex.init({
    appId: location.href,
    loader: loader,
    source: page,
    rootId: 'weex',
  })
  })();
  
  </script>
</body>
</html>
